Skip to content

Conversation

matthiask
Copy link
Member

@matthiask matthiask commented Jul 15, 2025

Description

Currently, the staticfiles panel contains one entry per static() call. That's not the same thing as used staticfiles, since assets can be deduplicated in multiple ways, e.g. through forms.Media or because the browser actually understands that it should load <script type="module"> once only.

I think it makes more sense to show a deduplicated and sorted list of static files used.

Refs feincms/django-prose-editor#48

Checklist:

  • I have added the relevant tests for this change.
  • I have added an item to the Pending section of docs/changes.rst.

Copy link
Member

@tim-schilling tim-schilling left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Makes sense and looks good!

@matthiask matthiask merged commit afd5e7e into django-commons:main Jul 15, 2025
25 checks passed
@matthiask
Copy link
Member Author

Thanks!

@matthiask matthiask deleted the mk/staticfile-deduplication branch July 15, 2025 11:02
matthiask added a commit that referenced this pull request Jul 22, 2025
#2155 introduced deduplication and sorting of static files, however the StaticFile object wasn't orderable at all.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants